Problem: $f(x) = \begin{cases} -2x +6 & \text{for} ~~~~x\lt2 \\ 2\cos(\pi x) & \text{for} ~~~~ x \geq2\end{cases}$ Evaluate the definite integral. $\int^4_{1}f(x)\,dx = $ Choose 1 answer: Choose 1 answer: (Choice A) A $\dfrac12$ (Choice B) B $3$ (Choice C) C $\dfrac12 + \dfrac1\pi$ (Choice D) D $\dfrac12 - \dfrac1\pi$
Explanation: Splitting up the definite integral Since we're working with a piecewise function, we need to split the definite integral up into two pieces: $\phantom{=} \int^4_{1}f(x)\,dx$ $= \int^2_{1}f(x)\,dx + \int^4_{2}f(x)\,dx~~~~~~$ [Why did we split at 2?] $= \int^2_{1}(-2x +6)\,dx + \int^4_{2}2\cos(\pi x)\,dx ~~~~~~$ Evaluating each piece Next, let's evaluate each of these definite integrals one at a time. The first definite integral: $\begin{aligned} \int^2_{1} (-2x +6)\,dx~ &=-x^2 + 6x\Bigg|^2_{{1}} \\\\ &= \left[-( 2)^2 + 6\cdot(2) \right] - \left[-({1})^2 + 6\cdot({1}) \right] \\\\ &= \left[8\right] -\left[5 \right] \\\\ &= {3}\end{aligned}$ The second definite integral: $\begin{aligned} \int^4_{2}2\cos(\pi x)\,dx~ &=\dfrac{2\sin(\pi x)}{\pi}\Bigg|^4_{{2}} \\\\ &= \left[\dfrac{2\sin(\pi \cdot 4)}{\pi}\right] - \left[\dfrac{2\sin(\pi \cdot 2)}{\pi}\right] \\\\ &= \left[\dfrac{2\sin(4\pi)}{\pi}\right] - \left[\dfrac{2\sin(2\pi)}{\pi}\right] \\\\ &= [0] - [0] \\\\ &= {0}\end{aligned}$ Putting the pieces together Now let's add these two pieces together to find the answer: $\phantom{=} \int^2_{1}(-2x +6)\,dx + \int^4_{2}2\cos(\pi x)\,dx$ $ = {3} + {0}$ $ = 3$ The answer $\int^4_{1}f(x)\,dx = 3$